#ifndef VMCELL_H_
#define VMCELL_H_

#include "vmsys.h"

#ifdef __cplusplus
extern "C" {
#endif

/*Struct of CELL info*/
typedef struct{
    VMUINT16 arfcn;           /*Number of comunication channel*/
    VMUINT8 bsic;              /*Identity code of base station*/
    VMUINT8 rxlev;            /*Strength level of receiving*/
    VMUINT16 mcc;            /*Country code*/
    VMUINT16 mnc;            /*Network code*/
    VMUINT16 lac;              /*Region code*/
    VMUINT16 ci;                /*Cell identity*/
}vm_cell_info_struct;

/*Cell register status*/
typedef enum{
	VM_CELL_OPEN_SUCCESS = 0,			/*Open success*/
	VM_CELL_OPEN_ALREADY_OPEN = 1,	/*Already open*/	
	VM_CELL_OPEN_RES_LESS = -1,		/*Lack of resource*/
	VM_CELL_OPEN_REG_ERROR = -2		/*Cell register error*/
} vm_cell_reg_state_enum;

/**
 * Open CELL function.
 *
 * @return	VM_CELL_OPEN_SUCCESS: Open success; 
 * 			VM_CELL_OPEN_ALREADY_OPEN: Already open
 * 			VM_CELL_OPEN_RES_LESS: Lack of resource
 *			VM_CELL_OPEN_REG_ERROR: CELL register error
 */
VMINT vm_cell_open(void);

/**
 * Close CELL function.
 */
void vm_cell_close(void);

/**
 * Get the info of current cell.
 * vm_cell_open must be called before this, otherwise NULL will be returned.
 *
 * @return	If vm_cell_open is called, return the pointer of CELL info struct of current cell,
 *			Otherwise, return NULL pointer.
 */
vm_cell_info_struct* vm_cell_get_cur_cell_info(void);

/**
 * Get the info of adjacent cells.
 * vm_cell_open must be called before this, otherwise NULL will be returned.
 *
 * @return	If vm_cell_open is called, return the pointer of CELL info struct of current cell,
 *			Otherwise, return NULL pointer.
 */
vm_cell_info_struct** vm_cell_get_nbr_cell_info(void);

/**
 * Get the count of adjacent cells of current cell.
 * vm_cell_open must be called before this, otherwise NULL will be returned.
 *
 * @return	If vm_cell_open is called, return the pointer of CELL info struct of current cell,
 *			Otherwise, return NULL pointer.
 */
VMINT* vm_cell_get_nbr_num(void);

#ifdef __cplusplus
}
#endif 
#endif

